package com.xja.git.service.impl;

import com.xja.git.entity.Book;
import com.xja.git.mapper.BookMapper;
import com.xja.git.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookMapper bookMapper;
    @Override
    public int add(Book book) {
        return bookMapper.insert(book);
    }

    @Override
    public Book queryById(Integer id) {
        return bookMapper.selectById(id);
    }

    @Override
    public int remove(Integer id) {
        return bookMapper.delete(id);
    }

    @Override
    public int modify(Book book) {
        return bookMapper.update(book);
    }

    @Override
    public List<Book> queryAll() {
        return bookMapper.selectAll();
    }
}
